#include <iostream>
using namespace std;
int sum(int n)
{
	int r=0;
	while(n!=0)
	{
	r+=n%10;
	n=n/10;
	}
return r;
}

int main()
{
	int x;
	cin>>x;
	cout<<sum(x)<<endl;
	return 0;
}


